<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?= $data['head']['Name'] ?>的简历</title>
    <?php if(!isset($_GET['download'])) { ?>
    <style>
        .resume-wrap {
            font-size: 10px;
            width: 704px;
            padding: 10px 10px 0;
            margin: auto;
        }
        .div-resumename {
            font-size: 22px;
            line-height: 22px;
            margin-bottom： 10px;
        }
        .ulinfo-resume li {
            font-size: 12px;
            line-height: 16px;
        }
        .ulinfo-resume em {
            height: 10px;
        }
        .resume-wrap .resume-head {
            height: 100px;
            background-position: 0 -40px;
            padding: 30px 30px 0;
        }
        .div-resumephoto {
            border: #fff 2px solid;
        }
        .div-resumephoto, .div-resumephoto img {
            width: 70px;
            height: 90px;
            object-fit: cover;
        }
        .resume-tab td {
            line-height: 12px;
            padding-bottom: 0;
        }
        .resume-item .resume-title {
            margin-bottom: 0;
        }
        .resume-title h2 {
            font-size: 14px;
        }
        .resume-item .resume-loopitem {
            margin-top: 0;
            line-height: 12px;
        }
        .resume-loopitem .title-loopitem {
            font-size: 12px;
            margin-bottom: 0;
            line-height: 16px;
        }
        .title-loopitem .dash-loopitem {
            height: 8px;
        }
    </style>
    <?php } ?>
</head>
<body>
<div class="resume-wrap">
    <div class="resume-head">
        <div class="resume-headlf">
            <div class="div-resumename"><?= $data['head']['Name'] ?></div>
            <ul class="ulinfo-resume clearfix" style="min-width: auto;">
                <li><em></em> <?= $data['head']['JobSearchStatus'] ?></li>
                <li><em></em><?= $data['head']['Gender'] ?></li>
                <li><em></em><?= (date('Y') - date('Y', strtotime($data['head']['DateOfBirth']))) ?></li>
                <li><em></em><?= $data['head']['EducationLevel'] ?></li>
                <li><em></em><?= $data['head']['WorkYear'] ?>年工作经验
                </li>
            </ul>
        </div>
        <div class="div-resumephoto">
            <img src="<?= $data['head']['Photo'] ?: '__CDN__/assets/addons/resume/images/pic-photo.jpg' ?>" alt="简历照片">
        </div>
    </div>
    <?php foreach ($data['groups'] as $group) { ?>
    <div class="resume-item">
        <div class="resume-title">
            <div class="titlelf-resume">
                <i class="icon-<?= $group['icon'] ?>"></i>
                <h2><?= $group['title'] ?></h2>
                <em class="icon-bgtitle"></em>
            </div>
            <div class="bgtitle-resume"></div>
        </div>

        <?php if (isset($group['text']) && $group['text'] != '') { ?>
        <div class="resume-loopitem">
            <?= isset($group['text']) ? str_replace("\n", "<br/>", $group['text']) : '' ?>
        </div>
        <?php } ?>

        <?php if (isset($group['infos']) && count($group['infos']) > 0) { ?>
        <div class="resume-loopitem">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="resume-tab">
                <?php foreach (array_chunk($group['infos'], 2) as $infos) { ?>
                <tr>
                    <?php if (count($infos) == 1) { ?>
                        <td width="86" class="td-fieldname"><?= $infos[0]['key'] ? $infos[0]['key'] . '：' : '' ?></td>
                        <td width="96%" class="td-field" colspan="3"><?= str_replace("\n", "<br/>", $infos[0]['value']) ?></td>
                    <?php } else { ?>
                        <?php foreach ($infos as $info) { ?>
                            <td width="86" class="td-fieldname"><?= $info['key'] ? $info['key'] . '：' : '' ?></td>
                            <td width="47%" class="td-field"><?= str_replace("\n", "<br/>", $info['value']) ?></td>
                        <?php } ?>
                    <?php } ?>
                </tr>
                <?php } ?>
            </table>
        </div>
        <?php } ?>

        <?php foreach ($group['rows'] as $row) { ?>
        <div class="resume-loopitem">
            <div class="title-loopitem">
                <em class="dash-loopitem"></em>
                <div class="time-looptitle"><?= $row['date'] ?></div>
                <div class="con-looptitle"><?= $row['title'] ?></div>
            </div>
            <div class="tab-loopitem">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="resume-tab">
                    <?php foreach (array_chunk($row['infos'], 2) as $infos) { ?>
                    <tr>
                        <?php if (count($infos) == 1 || ($infos[1]['key'] == '' && $infos[1]['value'] == '')) { ?>
                            <td width="86" class="td-fieldname"><?= $infos[0]['key'] ? $infos[0]['key'] . '：' : '' ?></td>
                            <td width="96%" class="td-field" colspan="3"><?= str_replace("\n", "<br/>", $infos[0]['value']) ?></td>
                        <?php } else { ?>
                            <?php foreach ($infos as $info) { ?>
                            <td width="86" class="td-fieldname"><?= $info['key'] ? $info['key'] . '：' : '' ?></td>
                            <td width="47%" class="td-field"><?= str_replace("\n", "<br/>", $info['value']) ?></td>
                            <?php } ?>
                        <?php } ?>
                    </tr>
                    <?php } ?>
                </table>
            </div>
        </div>
        <?php } ?>

    </div>
    <?php } ?>
</div>
</body>
</html>
